package com.example.meitao.task;

import android.os.AsyncTask;
import android.text.TextUtils;

import com.example.meitao.tools.HttpUtils;


/**
 * Created by 星星 on 2016/8/2.
 */
public abstract class NetTask extends AsyncTask<String,Void,String>{
    public abstract void onCallBack(String result);
    @Override
    protected String doInBackground(String... strings) {
        byte [] data = HttpUtils.getDataBytes(strings[0]);
        if(data!=null&&data.length>0) {
            return new String(data);
        }
        return null;

    }

    @Override
    protected void onPostExecute(String s) {
        if(!TextUtils.isEmpty(s)) {
            onCallBack(s);
        }
    }
}
